<?php

namespace frontend\models;

use Yii;

/**
 * This is the model class for table "{{%order_goods_item}}".
 *
 * @property integer $id
 * @property string $order_id
 * @property string $goods_name
 * @property integer $goods_num
 * @property integer $status
 */
class OrderGoodsItem extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%order_goods_item}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['order_id', 'goods_name', 'goods_num', 'status'], 'required'],
            [['goods_num', 'status'], 'integer'],
            [['order_id', 'goods_name'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'order_id' => 'Order ID',
            'goods_name' => 'Goods Name',
            'goods_num' => 'Goods Num',
            'status' => 'Status',
        ];
    }

    /**
     * @inheritdoc
     * @return OrderGoodsItemQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new OrderGoodsItemQuery(get_called_class());
    }
}
